package com.hundred.item.module.screen;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.citrus.turbine.Context;
import com.alibaba.citrus.turbine.Navigator;
import com.hundred.item.dao.ItemDao;
import com.hundred.item.dao.dataobject.ItemDO;
import com.hundred.item.dao.dataobject.ItemReqDO;

public class Itemlist {
	private static final Logger log = LoggerFactory.getLogger(Itemlist.class);

	@Autowired
	private ItemDao itemDao;


	public void execute(Context context, Navigator nav) {
		
		 ItemReqDO itemReq = new ItemReqDO();
		ItemDO itemDO = itemDao.getItemById(itemReq);
		
		if(itemDO==null){
			context.put("result", "noitem");
		}
		else{
			context.put("result", "ok");
			context.put("resultItem", itemDO);
		}
		
	}

	public ItemDao getItemDao() {
		return itemDao;
	}

	public void setItemDao(ItemDao itemDao) {
		this.itemDao = itemDao;
	}
}
